<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script src="${ctxStatic}/jquery/jquery-1.8.3.min.js"></script>
<meta name="decorator" content="default"/>


<style>
    .col-lg-10 {width: 98%;margin-left: 10px;padding-top:7px;text-align: left}
    .col-margin {margin: 10px 0px;}
    .col-width-9 {width: 100%;}
    .table-tr-left {width: 12%;min-width: 105px;}
    .table-tr-right {width: 88%}
    .table-title {
        font-size: 15px;
        font-weight: bold;
        padding-top:5px;
        text-align: center;
        width: 100%;
    }
</style>
<div class="panel-body" style="padding-top:10px;background-color: white;">
    <div class="col-lg-10">
        <form:form id="inputForm" data-parsley-validate="" modelAttribute="pregnantRecords" method="post" class="form-horizontal" >
            <input type="hidden" name="id" value="${pregnantRecords.id}" >
            <input type="hidden" name="clinicId" value="${clinicMaster.id}" >
            <input type="hidden" name="patientId" value="${clinicMaster.patientId}" >
            <input type="hidden" name="cardNo" value="${clinicMaster.patMasterIndex.cardNo}" >
            <input type="hidden" id="idNo" name="idNo" value="${clinicMaster.patMasterIndex.idNo}" >
            <input type="hidden" name="deptId" value="${clinicMaster.deptId}" >
            <input type="hidden" name="orgId" value="${clinicMaster.orgId}" >
            <input type="hidden" name="doctorUser" value="${pregnantRecords.doctorUser}" >

            <table border="1" width="100%" >
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">初&#8195;&#8195;诊</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                            <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">检查日期：</label>
                            <div class="col-sm-7">
                                <input type="text" name="testingDate"  id="testingDate"
                                       value="<fmt:formatDate value="${pregnantRecords.testingDate}" pattern="yyyy-MM-dd  HH:mm:ss" type="date" dateStyle="long" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd  HH:mm:ss',isShowClear:false});" class="form-control Wdate">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">就诊次数：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="visitNum" data-parsley-validate="true"
                                       id="visitNum" value="${pregnantRecords.visitNum}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">孕&#8195;&#8195;周：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="gestationalWeeks" id="gestationalWeeks" value="${pregnantRecords.gestationalWeeks}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">孕&#8195;&#8195;次：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phGestationalNum" id="phGestationalNum" value="${pregnantRecords.phGestationalNum}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">产&#8195;&#8195;次：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phBearingNum" id="phBearingNum" value="${pregnantRecords.phBearingNum}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">末次月经：</label>
                            <div class="col-sm-7">
                                <input type="text" name="lmpDate"  id="lmpDate"
                                       value="<fmt:formatDate value="${pregnantRecords.lmpDate}" pattern="yyyy-MM-dd" type="date" dateStyle="long" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" class="form-control Wdate">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">预产期：</label>
                            <div class="col-sm-7">
                                <input type="text" name="predueDate"  id="predueDate"
                                       value="<fmt:formatDate value="${pregnantRecords.predueDate}" pattern="yyyy-MM-dd" type="date" dateStyle="long" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" class="form-control Wdate">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">孕产史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">阴道分娩：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phVaginalDelivery"
                                       id="phVaginalDelivery" value="${pregnantRecords.phVaginalDelivery}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">剖宫产：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phCesareanSection"
                                       id="phCesareanSection" value="${pregnantRecords.phCesareanSection}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">足月产：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phFullTerm"
                                       id="phFullTerm" value="${pregnantRecords.phFullTerm}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">早&#8195;&#8195;产：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phCast"
                                       id="phCast" value="${pregnantRecords.phCast}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">超期产：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phOverdue"
                                       id="phOverdue" value="${pregnantRecords.phOverdue}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">自然流产：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phNaturalAbortion"
                                       id="phNaturalAbortion" value="${pregnantRecords.phNaturalAbortion}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">人工流产：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phArtificialAbortion"
                                       id="phArtificialAbortion" value="${pregnantRecords.phArtificialAbortion}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">死胎数：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phStillbirth"
                                       id="phStillbirth" value="${pregnantRecords.phStillbirth}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">死产数：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phDeadBirth"
                                       id="phDeadBirth" value="${pregnantRecords.phDeadBirth}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">出生缺陷儿：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phBirthDefect"
                                       id="phBirthDefect" value="${pregnantRecords.phBirthDefect}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">新生儿死亡：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="phNeonatalDeath"
                                       id="phNeonatalDeath" value="${pregnantRecords.phNeonatalDeath}" class="form-control">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">既往病史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="pastMedicalHistory"
                                   id="pastMedicalHistory" value="${pregnantRecords.pastMedicalHistory}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">家族病史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="familyHistory"
                                   id="familyHistory" value="${pregnantRecords.familyHistory}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">疫苗接种史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="vaccinationHistory"
                                   id="vaccinationHistory" value="${pregnantRecords.vaccinationHistory}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">药物过敏史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="drugAllergyHistory"
                                   id="drugAllergyHistory" value="${pregnantRecords.drugAllergyHistory}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">妇科手术史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="gyOperationHistory"
                                   id="gyOperationHistory" value="${pregnantRecords.gyOperationHistory}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">异常孕产史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="abnormalPregnancy"
                                   id="abnormalPregnancy" value="${pregnantRecords.abnormalPregnancy}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">本次妊娠<br>异常情况</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="abnormalPregnancyCon"
                                   id="abnormalPregnancyCon" value="${pregnantRecords.abnormalPregnancyCon}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">个人史</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="personalHistory"
                                   id="personalHistory" value="${pregnantRecords.personalHistory}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">叶酸服用</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="folicAcidUsed"
                                   id="folicAcidUsed" value="${pregnantRecords.folicAcidUsed}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">一般检查</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">血&#8195;&#8195;压：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="300" name="gexamBloodPressure" id="gexamBloodPressure"
                                       value="${pregnantRecords.gexamBloodPressure}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">mmHg</label>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">身&#8195;&#8195;高：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="300" name="gexamHeight" id="gexamHeight"
                                       value="${pregnantRecords.gexamHeight}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">Cm</label>
                        </div>

                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">体&#8195;&#8195;重：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="500" name="gexamWeight" id="gexamWeight"
                                       value="${pregnantRecords.gexamWeight}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">Kg</label>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">体重指数：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="999" name="gexamWeightBmi" id="gexamWeightBmi"
                                       value="${pregnantRecords.gexamWeightBmi}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin" >
                            <label class="col-sm-4 control-label">脉&#8195;&#8195;搏：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="999" name="gexamPulse" id="gexamPulse"
                                       value="${pregnantRecords.gexamPulse}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">bpm</label>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">心&#8195;&#8195;脏：</label>
                            <div class="col-sm-7">
                                <input type="text"  name="gexamHeart" id="gexamHeart"
                                       value="${pregnantRecords.gexamHeart}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">肺&#8195;&#8195;脏：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gexamLungs" id="gexamLungs"
                                       value="${pregnantRecords.gexamLungs}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">肝&#8195;&#8195;脏：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gexamLiver" id="gexamLiver"
                                       value="${pregnantRecords.gexamLiver}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">脾&#8195;&#8195;脏：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gexamSpleen" id="gexamSpleen"
                                       value="${pregnantRecords.gexamSpleen}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">四&#8195;&#8195;肢：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gexamLimbs" id="gexamLimbs"
                                       value="${pregnantRecords.gexamLimbs}" class="form-control">
                            </div>
                        </div>

                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">妇科检查</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">外&#8195;&#8195;阴：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gyexamVulva" id="gyexamVulva"
                                       value="${pregnantRecords.gyexamVulva}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">阴&#8195;&#8195;道：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gyexamVagina" id="gyexamVagina"
                                       value="${pregnantRecords.gyexamVagina}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">宫&#8195;&#8195;颈：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gyexamCervical" id="gyexamCervical"
                                       value="${pregnantRecords.gyexamCervical}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">子&#8195;&#8195;宫：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gyexamUterus" id="gyexamUterus"
                                       value="${pregnantRecords.gyexamUterus}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">附&#8195;&#8195;件：</label>
                            <div class="col-sm-7">
                                <input type="text" name="gyexamUterineAdnexa" id="gyexamUterineAdnexa"
                                       value="${pregnantRecords.gyexamUterineAdnexa}" class="form-control">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">产科检查</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">宫&#8195;&#8195;高：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="999" name="fundusHeight" id="fundusHeight"
                                       value="${pregnantRecords.fundusHeight}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">Cm</label>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">腰&#8195;&#8195;围：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="999" name="abdominalCircum" id="abdominalCircum"
                                       value="${pregnantRecords.abdominalCircum}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">Cm</label>
                        </div>

                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">胎心率：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="999" name="fetalHeartRate" id="fetalHeartRate"
                                       value="${pregnantRecords.fetalHeartRate}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">bpm</label>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">胎方位：</label>
                            <div class="col-sm-7">
                                <input type="text" name="fetalPosition" id="fetalPosition"
                                       value="${pregnantRecords.fetalPosition}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">胎先露：</label>
                            <div class="col-sm-7">
                                <input type="text" name="fetalPresentation" id="gyexamUtefetalPresentationrineAdnexa"
                                       value="${pregnantRecords.fetalPresentation}" class="form-control">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">辅助检查</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">血常规：</label>
                            <div class="col-sm-7">
                                <input type="text" name="labRbt" id="labRbt"
                                       value="${pregnantRecords.labRbt}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">血&#8195;&#8195;型：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labBloodType}"
                                            lists="${fns:getDictList('BLOOD_TYPE_DICT')}"
                                            className="form-control" name="labBloodType"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">RH血型：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labBloodTypeRh}"
                                            lists="${fns:getDictList('BLOOD_TYPE_RH_DICT')}"
                                            className="form-control" name="labBloodTypeRh"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">尿常规：</label>
                            <div class="col-sm-7">
                                <input type="text" name="labUrineRoutine" id="labUrineRoutine"
                                       value="${pregnantRecords.labUrineRoutine}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">肝功能：</label>
                            <div class="col-sm-7">
                                <input type="text" name="labLiverFunction" id="labLiverFunction"
                                       value="${pregnantRecords.labLiverFunction}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">肾功能：</label>
                            <div class="col-sm-7">
                                <input type="text" name="labRenalFunction" id="labRenalFunction"
                                       value="${pregnantRecords.labRenalFunction}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">血&#8195;&#8195;糖：</label>
                            <div class="col-sm-4">
                                <input type="number" min="0" max="99" name="labBloodGlucose" id="labBloodGlucose"
                                       value="${pregnantRecords.labBloodGlucose}" class="form-control">
                            </div>
                            <label class="col-sm-2 control-label">mmol/L</label>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">超&#8195;&#8195;声：</label>
                            <div class="col-sm-7">
                                <input type="text" name="labUltrasound" id="labUltrasound"
                                       value="${pregnantRecords.labUltrasound}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">阴道分泌物：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labVaginalSecretions}"
                                            lists="${fns:getDictList('VAGINAL_SECRETIONS')}"
                                            className="form-control" name="labVaginalSecretions"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">阴道清洁度：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labVaginalCleanliness}"
                                            lists="${fns:getDictList('VAGINAL_CLEANLINESS')}"
                                            className="form-control" name="labVaginalCleanliness"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">HIV抗体：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHiv}"
                                            lists="${fns:getDictList('HIV_ANTIBODY')}"
                                            className="form-control" name="labHiv"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">弓形体1gM：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labToxo}"
                                            lists="${fns:getDictList('TOXOPLASM')}"
                                            className="form-control" name="labToxo"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">风疹病毒：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labRubellaVirus}"
                                            lists="${fns:getDictList('RUBELLA_VIRUS')}"
                                            className="form-control" name="labRubellaVirus"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">巨细胞病毒：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labCytomegalovirus}"
                                            lists="${fns:getDictList('CYTOMEGALO_VIRUS')}"
                                            className="form-control" name="labCytomegalovirus"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">乙肝表面抗原：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHbsag}"
                                            lists="${fns:getDictList('HBsAg')}"
                                            className="form-control" name="labHbsag"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">乙肝表面抗体：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHbsab}"
                                            lists="${fns:getDictList('HBsAb')}"
                                            className="form-control" name="labHbsab"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">乙型肝炎E抗原：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHbeag}"
                                            lists="${fns:getDictList('HBeAg')}"
                                            className="form-control" name="labHbeag"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">乙型肝炎E抗体：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHbeab}"
                                            lists="${fns:getDictList('HBeAb')}"
                                            className="form-control" name="labHbeab"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">乙肝核心抗体：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHbcab}"
                                            lists="${fns:getDictList('HBcAb')}"
                                            className="form-control" name="labHbcab"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">梅毒血清学实验：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labSyphilisTest}"
                                            lists="${fns:getDictList('SYPHILIS_TEST')}"
                                            className="form-control" name="labSyphilisTest"></sys:select>
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">单纯疱病毒：</label>
                            <div class="col-sm-7">
                                <sys:select isNull="1" checkValue="${pregnantRecords.labHerpesSimplex}"
                                            lists="${fns:getDictList('HERPES_SIMPLEX')}"
                                            className="form-control" name="labHerpesSimplex"></sys:select>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">其他检查</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="otherExam"
                                   id="otherExam" value="${pregnantRecords.otherExam}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">骨盆外测量</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">髂嵴间径：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="pelvisIntercrestalDiameter"
                                       id="pelvisIntercrestalDiameter" value="${pregnantRecords.pelvisIntercrestalDiameter}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">髂棘间径：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="pelvisInterspinalDiameter"
                                       id="pelvisInterspinalDiameter" value="${pregnantRecords.pelvisInterspinalDiameter}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">骶耻外径：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="pelvisOd"
                                       id="pelvisOd" value="${pregnantRecords.pelvisOd}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">出口横径：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="pelvisTransverseOutlet"
                                       id="pelvisTransverseOutlet" value="${pregnantRecords.pelvisTransverseOutlet}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-4 col-margin">
                            <label class="col-sm-4 control-label">骶骨弓角度：</label>
                            <div class="col-sm-7">
                                <input type="number" min="0" max="99" name="pelvisSacralArchAngle"
                                       id="pelvisSacralArchAngle" value="${pregnantRecords.pelvisSacralArchAngle}" class="form-control">
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">高危评估</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <table  width="100%" >
                            <tr>
                                <td>
                                    <div class="col-sm-4 col-margin">
                                        <label class="col-sm-4 control-label">是否高危：</label>
                                        <div class="col-sm-7">
                                            <sys:select onclick="selectOnclick(this)"
                                                    checkValue="${pregnantRecords.hrs}"
                                                    lists="${fns:getDictList('HIGH_RISK_ASSESSMENT')}"
                                                    className="form-control" name="hrs"></sys:select>
                                        </div>

                                    </div>
                                    <div class="col-sm-4 col-margin">
                                        <label class="col-sm-4 control-label">评&#8195;&#8195;分：</label>
                                        <div class="col-sm-7">
                                            <input type="number" min="0" max="99" name="hrsScore"
                                                   id="hrsScore" value="${pregnantRecords.hrsScore}" class="form-control">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="col-margin">
                                        <label class="col-sm-2 control-label" style="width: 11.5%;" >高危因素：</label>
                                        <div class="col-sm-10" style="padding-left: 7px ;width: 88.5%">
                                            <input type="text"  name="hrsReason"
                                                   id="hrsReason" value="${pregnantRecords.hrsReason}" class="form-control">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="col-margin col-sm-11" style="width:100%;">
                                        <label class="col-sm-2 control-label" style="width: 10.8%;" >总体评估：</label>
                                        <div class="col-sm-10"  style="padding-left: 6px;width: 89.2%;padding-right: 0;"  >
                                            <input type="text"  name="overallEvaluation"
                                                   id="overallEvaluation" value="${pregnantRecords.overallEvaluation}" class="form-control">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">保健指导</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="healthGuidance"
                                   id="healthGuidance" value="${pregnantRecords.healthGuidance}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">诊&#8195;&#8195;断</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="diagRecord"
                                   id="diagRecord" value="${pregnantRecords.diagRecord}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">处理意见</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-lg-11 col-margin col-width-9">
                            <input type="text"  name="treatmentAdvice"
                                   id="treatmentAdvice" value="${pregnantRecords.treatmentAdvice}" class="form-control">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">转诊情况</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <table  width="100%" >
                            <tr>
                                <td>
                                    <div class="col-sm-4 col-margin">
                                        <label class="col-sm-4 control-label">是否转诊：</label>
                                        <div class="col-sm-7">
                                            <sys:select onclick="selectOnclick(this)"
                                                    checkValue="${pregnantRecords.referral}"
                                                    lists="${fns:getDictList('PREGNANT_REFERRAL')}"
                                                    className="form-control" name="referral"></sys:select>
                                        </div>
                                    </div>
                                    <div class="col-sm-8 col-margin" style="padding-right: 2px;">
                                        <label class="col-sm-3 control-label" >转诊机构及科室：</label>
                                        <div class="col-sm-9">
                                            <input type="text" name="referralCompany"
                                                   id="referralCompany" value="${pregnantRecords.referralCompany}" class="form-control">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="col-margin col-sm-11" style="width:100%;">
                                        <label class="col-sm-2 control-label" style="width: 10.8%;" >转诊原因：</label>
                                        <div class="col-sm-10"  style="padding-left: 6px;width: 89%;padding-right: 0;"  >
                                            <input type="text" name="referralReason"
                                                   id="referralReason" value="${pregnantRecords.referralReason}" class="form-control">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="table-tr-left">
                        <div class="col-margin">
                            <label class="table-title">检查信息</label>
                        </div>
                    </td>
                    <td class="table-tr-right">
                        <div class="col-sm-6 col-margin">
                            <label class="col-sm-3 control-label" style="width: 22%">检查单位：</label>
                            <div class="col-sm-7">
                                <input type="text" name="inspectionUnit" readonly="true"
                                       id="inspectionUnit" value="${pregnantRecords.inspectionUnit}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-6 col-margin">
                            <label class="col-sm-3 control-label">检查科室：</label>
                            <div class="col-sm-7">
                                <input type="text" name="deptName" readonly="true"
                                       id="deptName" value="${pregnantRecords.deptName}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-6 col-margin">
                            <label class="col-sm-3 control-label" style="width: 22%">检查医师：</label>
                            <div class="col-sm-7">
                                <input type="text" name="doctorName" readonly="true"
                                       id="doctorName" value="${pregnantRecords.doctorName}" class="form-control">
                            </div>
                        </div>
                        <div class="col-sm-6 col-margin">
                            <label class="col-sm-3 control-label">预约检查日期：</label>
                            <div class="col-sm-7">
                                <input type="text" name="appointmentDate"  id="appointmentDate" readonly="true"
                                       value="<fmt:formatDate value="${pregnantRecords.appointmentDate}" pattern="yyyy-MM-dd" type="date" dateStyle="long" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" class="form-control Wdate">
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </form:form>
    </div>
</div>
<%--<script src="${ctxStatic}/js/doctor/pregnantRecordsForm.js"></script>--%>
<script>
    $(function () {

    var hrs=$("#hrs").val();
    var referral=$("#referral").val();
    if(hrs=='1'){
        $("#hrsScore").attr("disabled", "true");
        $("#hrsReason").attr("disabled", "true");
    }
    if(referral=='1'){
        $("#referralCompany").attr("disabled", "true");
        $("#referralReason").attr("disabled", "true");
    }
    /*
     * 加载既往病史下拉框
     */
    $("input[name='pastMedicalHistory']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'ANAMNESIS'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'ANAMNESIS'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载家族病史下拉框
     */
    $("input[name='familyHistory']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'FAMILY_MEDICAL_HISTORY'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'FAMILY_MEDICAL_HISTORY'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载疫苗接种史下拉框
     */
    $("input[name='vaccinationHistory']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'VACCINATION_HISTORY'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'VACCINATION_HISTORY'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载药物过敏史下拉框
     */
    $("input[name='drugAllergyHistory']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'DRUG_ALLERGY_HISTORY'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'DRUG_ALLERGY_HISTORY'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载妇科手术史下拉框
     */
    $("input[name='gyOperationHistory']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'GYNECOLOGICAL_SURGERY_HISTORY'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'GYNECOLOGICAL_SURGERY_HISTORY'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载异常孕产史下拉框
     */
    $("input[name='abnormalPregnancy']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'ABNORMAL_PREGNANCY_LABOR_HISTORY'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'ABNORMAL_PREGNANCY_LABOR_HISTORY'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载本次妊娠异常情况下拉框
     */
    $("input[name='abnormalPregnancyCon']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'ABNORMAL_PREGNANCY_CONDITION'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'ABNORMAL_PREGNANCY_CONDITION'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载个人史下拉框
     */
    $("input[name='personalHistory']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'PERSONAL_MEDICAL_HISTORY'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'PERSONAL_MEDICAL_HISTORY'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载叶酸服用下拉框
     */
    $("input[name='folicAcidUsed']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'TAKE_FOLATE'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'TAKE_FOLATE'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载其他检查下拉框
     */
    $("input[name='otherExam']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'OTHER_CHECKS'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'OTHER_CHECKS'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载高危因素下拉框
     */
    $("input[name='hrsReason']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'HIGH_RISK_FACTOR'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'HIGH_RISK_FACTOR'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载总体评估下拉框
     */
    $("input[name='overallEvaluation']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'OVERALL_EVALUATION'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'OVERALL_EVALUATION'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载保健指导下拉框
     */
    $("input[name='healthGuidance']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'HEALTH_GUIDANCE'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'HEALTH_GUIDANCE'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载诊断下拉框
     */
    $("input[name='diagRecord']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'PREGNANT_DIAGNOSIS'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'PREGNANT_DIAGNOSIS'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    /*
     * 加载处理意见下拉框
     */
    $("input[name='treatmentAdvice']").select2({
        minimumInputLength: 1,
        multiple             : true,
        separator            : ";",
        initSelection        : function (element, callback) {   // 初始化时设置默认值
            $.ajax({
                url:ctx+"/doctor/pregnantRecords/automatic",
                data:{ids:element.val(),type:'PREGNANT_TREATMENT_ADVICE'},
                type: 'post', // 提交方式 get/post
                success:function(data){
                    var row = jQuery.parseJSON(data);
                    callback(row.items)
                }
            })
        },
        createSearchChoice   : function(term, data) {           // 创建搜索结果（使用户可以输入匹配值以外的其它值）
            return { id: term, text: term };
        },
        ajax : {
            url      : ctx+"/doctor/pregnantRecords/automatic",              // 异步请求地址
            data: function (term) {
                return {
                    q: term,type:'PREGNANT_TREATMENT_ADVICE'
                };
            },
            results: function (data) {
                return {
                    results: data.items
                };

            }
        },
        formatSelection : resultFormatSelection,  // 选择结果中的显示
        formatResult    : resultFormatResult,
        escapeMarkup : function (m) { return m; }

    });
    });
    function selectOnclick(obj){
        //referral
        if(obj.id=='hrs'){
            if(obj.selectedIndex==0){
                $("#hrsScore").attr("disabled", "true");
                $("#hrsScore").val("");

                $("#hrsReason").val(null).trigger("change");
                $("#hrsReason").attr("disabled", "true");
                //console.dir($("#s2id_hrsReason ul li"));
                //$("#s2id_hrsReason ul li.select2-search-choice").remove();
                /*问下自带下拉框怎么清空值*/

            }
            else{
                $("#hrsScore").removeAttr("disabled");
                $("#hrsReason").removeAttr("disabled");
            };
        }
        if(obj.id=='referral'){
            if(obj.selectedIndex==0){
                $("#referralCompany").attr("disabled", "true");
                $("#referralCompany").val("");
                $("#referralReason").attr("disabled", "true");
                $("#referralReason").val("");
            }
            else{
                $("#referralCompany").removeAttr("disabled");
                $("#referralReason").removeAttr("disabled");
            };
        }

    }
    function resultFormatResult(medata) {
        return medata.text;
    }
    function resultFormatSelection(medata) {
        return medata.text+"<input type='hidden' value='"+medata.id+"'/>";
    }
</script>
